<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf">日志列表</div>
                </div>
                <div class="widget-body am-fr">
                    <!-- 工具栏 -->
                    <div class="widget-body am-fr">
                        <!-- 工具栏 -->
                        <div class="page_toolbar am-margin-bottom-xs am-cf">
                            <form id="form-search" class="toolbar-form" action="">
                                <input type="hidden" name="s" value="/<?= $request->pathinfo() ?>">
                                <div class="am-u-sm-12 am-u-md-9" style="float: right;">
                                    <div class="am fr">
                                        <div class="am-form-group tpl-form-border-form am-fl">
                                            <input type="text" name="start_time"
                                                   class="am-form-field"
                                                   value="<?= $request->get('start_time') ?>" placeholder="修改起始日期"
                                                   data-am-datepicker readonly>
                                        </div>
                                        <div class="am-form-group tpl-form-border-form am-fl">
                                            <input type="text" name="end_time"
                                                   class="am-form-field"
                                                   value="<?= $request->get('end_time') ?>" placeholder="修改截止日期"
                                                   data-am-datepicker readonly>
                                        </div>
                                        <div class="am-form-group am-fl">
                                            <div class="am-input-group am-input-group-sm tpl-form-border-form">

                                                <div class="am-input-group-btn" style="width: auto;">
                                                    <button class="am-btn am-btn-default am-icon-search"
                                                            type="submit"></button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>

                        </div>
                    <div class="am-scrollable-horizontal am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped
                         tpl-table-black am-text-nowrap">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>开始时间</th>
                                <th>分红周期(天)</th>
                                <th>分红条件(天)</th>
                                <th>分红上限(%)</th>
                                <th>实物参与分红</th>
                                <th>零钱抵扣比例(%)</th>
                                <th>零钱抵扣开关</th>
                                <th>分红状态</th>
                                <th>期数</th>
                                <th>设备来源</th>
                                <th>修改时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
                                <tr>
                                    <td class="am-text-middle"><?= $item['id'] ?></td>
                                    <td class="am-text-middle"><?= $item['values']['start_time'] ?></td>
                                    <td class="am-text-middle"><?= $item['values']['term'] ?></td>
                                    <td class="am-text-middle"><?= $item['values']['money'] ?></td>
                                    <td class="am-text-middle"><?= $item['values']['upline'] ?></td>
                                    <td class="am-text-middle">
                                        <?php if(isset($item['values']['real_reward'])):?>
                                            <?php if($item['values']['real_reward']==1):?>
                                                <span class="j-state am-badge x-cur-p
                                           am-badge-success">
                                                开启
                                           </span>
                                            <?php elseif($item['values']['real_reward']==0):?>
                                                <span class="j-state am-badge x-cur-p
                                           am-badge-warning">
                                                关闭
                                           </span>
                                            <?php endif;?>
                                        <?php else:?>

                                            <span class="j-state am-badge x-cur-p
                                           am-badge-warning">
                                                关闭
                                           </span>
                                        <?php endif;?>

                                    </td>
                                    <td class="am-text-middle"><?= $item['values']['moneypercent'] ?></td>
                                    <td class="am-text-middle">
                                        <?php if($item['values']['moneypercentstatus']==1):?>
                                            <span class="j-state am-badge x-cur-p
                                           am-badge-success">
                                                开启
                                           </span>
                                        <?php elseif($item['values']['moneypercentstatus']==2):?>
                                            <span class="j-state am-badge x-cur-p
                                           am-badge-warning">
                                                关闭
                                           </span>
                                        <?php endif;?>
                                    </td>
                                    <td class="am-text-middle">
                                        <?php if($item['values']['status']==1):?>
                                            <span class="j-state am-badge x-cur-p
                                           am-badge-success">
                                                开启
                                           </span>
                                        <?php elseif($item['values']['status']==2):?>
                                            <span class="j-state am-badge x-cur-p
                                           am-badge-warning">
                                                关闭
                                           </span>
                                        <?php endif;?>
                                    </td>
                                    <td class="am-text-middle"><?= $item['values']['periods_num'] ?></td>
                                    <td class="am-text-middle">
                                        <?= $item['deviceType']?:"未知" ?>
                                    </td>
                                    <td class="am-text-middle"><?= $item['create_time'] ?></td>

                                </tr>
                            <?php endforeach; else: ?>
                                <tr>
                                    <td colspan="9" class="am-text-center">暂无记录</td>
                                </tr>
                            <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr"><?= $list->render() ?></div>
                        <div class="am-fr pagination-total am-margin-right">
                            <div class="am-vertical-align-middle">总记录：<?= $list->total() ?></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>